#pragma once

#include "Pages/EditorPageModel.h"
#include "EditorMeshPageModel.m.h"

class RStaticMesh;
class RMaterial;

RCLASS(ExtraHeader= "Mesh/StaticMesh.h")
class REditorMeshPageModel : public REditorPageModel
{
    ROBJECT

public:
    virtual TSharedObjectPtr<REditorPageModel> ShareClone(RObject* InOwner) const override;
    virtual SPath GetFilePath() const override
    {
        return FilePath;
    }

    virtual TSharedObjectPtr<RObject> GetFocuseObject() const override ;


    static TSharedObjectPtr<REditorMeshPageModel> Create(const SPath&  InFilePath, TSharedObjectPtr<RStaticMesh> InMesh);

    TSharedObjectPtr<RStaticMesh> GetMesh() const;

    void SetMaterial(int64_t MaterialSlotIndex, TSharedObjectPtr<RMaterial> InMaterial);

    RFIELD()
    TSharedObjectPtr<RStaticMesh> Mesh;

    RFIELD()
    SPath FilePath;

    virtual void LowLevelSave() override;

};